package com.io;

import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

public class FileWriterDemo01 {

    public static void main(String[] args) throws IOException {
        FileWriter fileWriter = new FileWriter("d:\\dev\\1\\fw.txt");
        Scanner scanner = new Scanner(System.in);
        while(true) {
            System.out.println("请输入");
            String msg= scanner.nextLine();
            fileWriter.write(msg.trim());
            if(msg.equals("886"))
                break;

        }
        scanner.close();
        fileWriter.close();
    }
}
